<template>
    <Table border :context="self" :columns="columns7" :data="data6"></Table>
</template>
<script>
    export default {
        data () {
            return {
                self: this,
                columns7: [
                    {
                        title: '序号',
                        key: 'id'
                    },
                    {
                        title: '推荐手机号',
                        key: 'phone'
                    },
                    {
                        title: '推荐人姓名',
                        key: 'name',
                        render (row, column, index) {
                            return `<Icon type="person"></Icon> <strong>${row.name}</strong>`;
                        }
                    },{
                        title: '推荐人身份证号码',
                        key: 'card'
                    },{
                        title: '被推荐人手机号',
                        key: 'cardState'
                    },{
                        title: '被推荐人姓名',
                        key: 'payState'
                    },{
                        title: '被推荐人身份证号',
                        key: 'title'
                    },{
                        title: '被推荐人身份认证',
                        key: 'ordertime'
                    },
                    { title: '被推荐人会员支付',
                        key: 'action',
                        width: 150,
                        align: 'center',
                        render (row, column, index) {
                            return `<i-button type="primary" size="small" @click="show(${index})">编辑</i-button> <i-button type="error" size="small" @click="remove(${index})">删除</i-button>`;
                        }
                    }
                ],
                data6: [
                    {
                        id: '',
                        phone: 0,
                        name: '',
                        card:'',
                        cardState:'',
                        payState:'',
                        title:'',
                        ordertime:'',
                        price:'',
                        orderstate:''
                    }
                    
                ]
            }
        },
         mounted: function () {
            this.$http.get("http://www.htmlk.cn:80/orderadminAll").then((response) => {
                  console.log(response.data)
                  this.$data.data6=response.data
                })
            
        },
        methods: {
            show (index) {
                this.$Modal.info({
                    title: '用户信息',
                    content: `商品名称：${this.data6[index].title}<br>下单时间：${this.data6[index].ordertime}<br>状态：${this.data6[index].orderstate}<br>状态：${this.data6[index].price}`
                })
            },
            remove (index) {
                this.data6.splice(index, 1);
            }
        }
    }
</script>